package com.boot.service.impl;

import com.boot.entity.Latest;
import com.boot.mapper.UpdateDao;
import com.boot.service.UpdateService;
import com.boot.util.AdResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UpdateServiceImpl implements UpdateService {

	@Resource
	private UpdateDao updateDao;
	
	@Override
	public AdResult getLatest() {
		AdResult adResult =new AdResult();
		Latest latest=updateDao.getLatest();
		if(latest!=null){
			adResult.setData(latest);
			adResult.setMsg("获取最新一条更新提示");
			adResult.setStatus(1);
		}else{
			adResult.setMsg("获取失败");
			adResult.setStatus(0);
		}
		return adResult;
	}

}
